// 轮播图业务相关代码
import { ref ,onMounted} from 'vue'
import { getBannerAPI } from '@/api/layout';
export function useBanner() {
    const BannerList = ref([])
    const getBanner = async () => {
        const { data: res } = await getBannerAPI({
            distributionSite: '2'
        })
        if (res.code !== '1') return ElMessage.error(res.msg)
        BannerList.value = res.result
    }

    onMounted(() => {
        getBanner()
    })

    return{
        BannerList
    }
}